#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    string reverseStr(string s, int k) {
        auto it = s.begin();
        while (it + k <= s.end())
        {
            reverse(it, it + k);
            it += (2 * k);
        }
        reverse(it, s.end());

        return s;
    }
};